﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using WinAutomator.Library.BuildIns;
using WinAutomator.Library.InOut;
using WinAutomator.Plugin.BuildIns;

namespace WinAutomator.Library.Tests
{
    [TestClass]
    public class WorkflowTest
    {
        [TestMethod]
        public void TestMethod1()
        {
            WASetString w1 = new WASetString();
            w1.Message = "salut les amis";
            WAConsoleWrite w2 = new WAConsoleWrite();
            VirtualConnector w1out = w1.getVirtualConnectors(InOut.WAInOut.Out)[0];
            VirtualConnector w2in = w2.getVirtualConnectors(InOut.WAInOut.In)[0];
            w1out.TryToConnect(w2in);
            WAWorkflow wf = new WAWorkflow();
            wf.SetRoot(w1);
            wf.Start();
        }


        [TestMethod]
        public void TestMethod2()
        {
            WAReadDirectory w1 = new WAReadDirectory();
            w1.WADirectory = @"c:\";
            WAConsoleWrite w2 = new WAConsoleWrite();
            VirtualConnector w1out = w1.getVirtualConnectors(InOut.WAInOut.Out)[0];
            VirtualConnector w2in = w2.getVirtualConnectors(InOut.WAInOut.In)[0];
            w1out.TryToConnect(w2in);
            WAWorkflow wf = new WAWorkflow();
            wf.SetRoot(w1);
            wf.Start();
        }
    }
}
